<template>
  <div>{{ message }}</div>
  <button @click="sendMessage">给父组件发消息</button>
</template>

<script setup>
defineProps({
  message: String,
});

const emit = defineEmits(['msg-send'])

const sendMessage = ()=>{
  emit('msg-send','子组件的消息')
}

</script>